home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-11-19 | 3.3 KB | 193 lines | [TEXT/MPS ] |
- /*
- File: List.cp
-
- Contains: TList implementation. A front end to the list manager.
-
- Copyright: © 1991-1994 by Apple Computer, Inc., all rights reserved.
-
- */
-
-
- #ifndef __LIST__
- #include "List.h"
- #endif
-
- TList::TList()
- {
- fList = NULL;
- }
-
- TList::TList(const Rect *rView, const Rect *dataBounds, Point cSize,
- short theProc, WindowPtr theWindow, Boolean drawIt, Boolean hasGrow,
- Boolean scrollHoriz, Boolean scrollVert)
- {
- InitList(rView, dataBounds, cSize, theProc, theWindow, drawIt, hasGrow,
- scrollHoriz, scrollVert);
- }
-
- TList::~TList()
- {
- if (fList)
- LDispose(fList);
- }
-
- void TList::InitList(const Rect *rView, const Rect *dataBounds, Point cSize,
- short theProc, WindowPtr theWindow, Boolean drawIt, Boolean hasGrow,
- Boolean scrollHoriz, Boolean scrollVert)
- {
- fList = LNew(rView, dataBounds, cSize, theProc, theWindow, drawIt, hasGrow,
- scrollHoriz, scrollVert);
- }
-
- short TList::AddColumn(short count,short colNum)
- {
- return LAddColumn(count, colNum, fList);
- }
-
- short TList::AddRow(short count,short rowNum)
- {
- return LAddRow(count, rowNum, fList);
- }
-
- short TList::AddRow(short count)
- {
- return LAddRow(count,this->GetLastRow() + 1, fList);
- }
-
- void TList::DelColumn(short count,short colNum)
- {
- LDelColumn(count, colNum, fList);
- }
-
- void TList::DelRow(short count,short rowNum)
- {
- LDelRow(count, rowNum, fList);
- }
-
- void TList::AddToCell(const void *dataPtr,short dataLen,Cell theCell)
- {
- LAddToCell(dataPtr,dataLen,theCell,fList);
- }
-
- void TList::ClrCell(Cell theCell)
- {
- LClrCell(theCell,fList);
- }
-
- void TList::GetCell(void *dataPtr,short *dataLen,Cell theCell)
- {
- LGetCell(dataPtr,dataLen,theCell,fList);
- }
-
- void TList::SetCell(const void *dataPtr,short dataLen,Cell theCell)
- {
- LSetCell(dataPtr,dataLen,theCell,fList);
- }
-
- void TList::CellSize(Point cSize)
- {
- LCellSize(cSize,fList);
- }
-
- Boolean TList::GetSelect(Boolean next,Cell *theCell)
- {
- return LGetSelect(next,theCell,fList);
- }
-
- void TList::SetSelect(Boolean setIt,Cell theCell)
- {
- LSetSelect(setIt,theCell,fList);
- }
-
- Boolean TList::Click(Point pt,short modifiers)
- {
- return LClick(pt,modifiers,fList);
- }
-
- Cell TList::LastClick()
- {
- return LLastClick(fList);
- }
-
- void TList::Find(short *offset,short *len,Cell theCell)
- {
- LGetCellDataLocation(offset,len,theCell,fList);
- }
-
- Boolean TList::NextCell(Boolean hNext,Boolean vNext,Cell *theCell)
- {
- return LNextCell(hNext,vNext,theCell,fList);
- }
-
- void TList::CellRect(Rect *cellRect,Cell theCell)
- {
- LRect(cellRect,theCell,fList);
- }
-
- Boolean TList::Search(const void *dataPtr,short dataLen,ListSearchUPP searchProc,
- Cell *theCell)
- {
- return LSearch(dataPtr,dataLen,searchProc,theCell,fList);
- }
-
- void TList::Size(short listWidth,short listHeight)
- {
- LSize(listWidth,listHeight,fList);
- }
-
- void TList::Draw(Cell theCell)
- {
- LDraw(theCell,fList);
- }
-
- void TList::DoDraw(Boolean drawIt)
- {
- LSetDrawingMode(drawIt,fList);
- }
-
- void TList::Scroll(short dCols,short dRows)
- {
- LScroll(dCols,dRows,fList);
- }
-
- void TList::AutoScroll()
- {
- LAutoScroll(fList);
- }
-
- void TList::Update(RgnHandle theRgn)
- {
- LUpdate(theRgn,fList);
- }
-
- void TList::Activate(Boolean act)
- {
- LActivate(act,fList);
- }
-
- void TList::SetSelFlags(char theFlags)
- {
- (**fList).selFlags = theFlags;
- }
-
- short TList::GetLastRow()
- {
- return (**fList).dataBounds.bottom;
- }
-
- short TList::GetLastColumn()
- {
- return (**fList).dataBounds.right;
- }
-
- ListHandle TList::GetList()
- {
- return fList;
- }
-
- Rect TList::GetListRect()
- {
- return (*fList)->rView;
- }
-
-